home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DOpus Plus
/
DOpus Plus.iso
/
Tutorial
/
C Guide
/
Simple_Module1
/
ModuleEntry.c
< prev
next >
Wrap
C/C++ Source or Header
|
1998-09-20
|
2KB
|
67 lines
/*******************************************************************
ModuleEntry.c
It must contain at least all what is here.
I would suggest to you not to write much more than the needed
calls to your functions here. So you may forget later a little
bit, that you are writing a library...
*********************************************************************/
// we are doing all other include stuff there
#include "includes/Project.h"
// I use heavily defines, so this must not so much reworked each time,
// I change only the Project.h...
ModuleInfo module_info =
{
MODULE_VER_NUMBER,
MODULE_NAME,
MODULE_CATALOG,
MODULE_FLAGS,
MODULE_FUNC_COUNT,
{ FUNC0_ID, COMMAND_0, FUNC0_DESCRIPTION, FUNC0_FLAGS, FUNC0_TEMPLATE }
};
// now you must modify some lines, if your module should have more than
// one command buildin...
// For example we make here at all 3 commands. The 3. command itself is a
// hidden command (is not shown in the commandlist...)
#if MODULE_FUNC_COUNT-1
ModuleFunction module_func[MODULE_FUNC_COUNT-1] =
{
{ FUNC1_ID, COMMAND_1, FUNC1_DESCRIPTION, FUNC1_FLAGS, FUNC1_TEMPLATE },
{ FUNC2_ID, COMMAND_2, FUNC2_DESCRIPTION, FUNC2_FLAGS, FUNC2_TEMPLATE }
};
#endif
// If you are a really nice programmer, you should provide the version
// string with some extra \0 's...
static char version[] = "\0$VER: " VERSION_STRING " " __AMIGADATE__ "\0";
/********************************************************************/
// Now we are ready to enter our program code...
int __asm __saveds L_Module_Entry( register __a0 char *args,
register __a1 struct Screen *screen,
register __a2 IPCData *ipc,
register __a3 IPCData *main_ipc,
register __d0 ULONG mod_id,
register __d1 EXT_FUNC(func_callback) )
{
// your function...
return 1;
}